<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Promise的链式调用1</title>
</head>
<body>

  <script>
    // new时传入一个函数(resolve, reject)
    // resolve,reject 本身就是函数

    new Promise((resolve, reject) => {

      //第一次网络请求
      setTimeout(() => {
        resolve()
      }, 1000)
    }).then(() => {
      console.log('Hello World')
      console.log('Hello World')
      console.log('Hello World')
      console.log('Hello World')

      return new Promise((resolve, reject) => {
        //第二次网络请求
        setTimeout(() => {
          resolve()
        }, 1000)
      })
    }).then(() => {
      console.log('Hello VueJs')
      console.log('Hello VueJs')
      console.log('Hello VueJs')
      console.log('Hello VueJs')

      return new Promise((resolve, reject) => {
        //第三次网络请求
        setTimeout(() => {
          resolve()
        }, 1000)
      })
    }).then(() => {
      console.log('Hello Python')
      console.log('Hello Python')
      console.log('Hello Python')
      console.log('Hello Python')
    })
  </script>
</body>
</html>